import {createRouter,createWebHistory} from 'vue-router'

//导入组件
import LoginVue from '@/views/Login.vue';
import LayoutVue from '@/views/Layout.vue'

//定义路由关系
const routes=[
    {path:'/login',component:LoginVue},
    {path:'/',component:LayoutVue,
        //重定向
        redirect: '/employee/list',
        children:[
            //用户管理
            { path: '/employee/list', component: () => import('@/views/member/list.vue') },
            { path: '/employee/save', component: () => import('@/views/member/add.vue') },
            //分类管理
            { path: '/category/list', component: () => import('@/views/category/list.vue') },
            //菜品管理
            { path: '/dish/list', component: () => import('@/views/food/list.vue') },
            { path: '/dish/save', component: () => import('@/views/food/add.vue') },
            //订单管理
            { path: '/order/list', component: () => import('@/views/order/list.vue') },
            //套餐管理
            { path: '/combo/list', component: () => import('@/views/combo/list.vue') },
            { path: '/combo/save', component: () => import('@/views/combo/add.vue') },
    ]},
]

//创建路由器
const router=createRouter({
    history:createWebHistory(),
    routes:routes
})
//导出路由
export default router